package DataStructureAndAlgorithm.Tedukuri.前缀和与差分;
import java.util.Scanner;
public class AcWing_100 {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int N = 100010;
        int n = in.nextInt();
        int[] a = new int[N];
        for (int i = 1; i <= n; i++){
            a[i] = in.nextInt();
        }
        for (int i = n; i > 1; i--){
            a[i] -= a[i- 1];
        }
        long pos = 0;
        long neg = 0;
        for (int i = 2; i <= n; i++){
            if (a[i] > 0) pos += a[i];
            else neg -= a[i];
        }
        System.out.println(Math.min(pos,neg) + Math.abs(pos - neg));
        System.out.println(Math.abs(pos - neg) + 1);
    }
}
